package de.szut.kundenverwaltung;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JCheckBox;
import javax.swing.JLabel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;

public class ButtonDrucken implements ActionListener{

	private JLabel rabatt_text;
	private JTextField nachname;
	private JTextField vorname;
	private JCheckBox katalog;
	private JRadioButton gold;
	private JRadioButton silber;
	private JRadioButton bronze;
	public ButtonDrucken(JLabel rabatt_text, JTextField field_nachname, JTextField field_vorname, JCheckBox katalog, JRadioButton gold, JRadioButton silber, JRadioButton bronze){
		this.rabatt_text = rabatt_text;
		this.nachname = field_nachname;
		this.vorname = field_vorname;
		this.katalog = katalog;
		this.gold = gold;
		this.silber = silber;
		this.bronze = bronze;
	}
	@Override
	public void actionPerformed(ActionEvent arg0) {
		System.out.println("Name: " + nachname.getText());
		System.out.println("Vorname: " + vorname.getText());
		if (gold.isSelected()){
			System.out.println("Kundenstatus: Goldkunde");
		}
		else if (silber.isSelected()){
			System.out.println("Kundenstatus: Silberkunde");
		}
		else if (bronze.isSelected()){
			System.out.println("Kundenstatus: Bronze");
		}
		System.out.println(rabatt_text.getText());
		System.out.println("Katalog schicken: "+ katalog.isSelected());
		System.out.println("##################################");
	}
}
